// <copyright file="Type.cs" company="Alan Dean">
// The MIT License

// Copyright (c) 2008 Alan Dean

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// </copyright>
// <author>Alan Dean</author>
// <email>alan.dean@thoughtpad.net</email>

namespace Semantic.Rdf.DublinCore
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.Runtime.Serialization;

    /// <summary>
    /// Represents a Dublin Core <see href="http://dublincore.org/documents/dces/#type">type</see> property.
    /// <para>This class cannot be inherited.</para>
    /// </summary>
    /// 
    /// <remarks>
    /// <list type="table">
    /// <item>
    ///   <term>Definition</term>
    ///   <description>The nature or genre of the resource.</description>
    /// </item>
    /// <item>
    ///   <term>Comment</term>
    ///   <description>
    ///   Recommended best practice is to use a controlled vocabulary such as the
    ///   <see href="http://dublincore.org/documents/dcmi-type-vocabulary/">DCMI Type Vocabulary</see>.
    ///   To describe the file format, physical medium, or dimensions of the resource, use the Format element.
    ///   </description>
    /// </item>
    /// </list>
    /// </remarks>
    /// 
    /// <seealso href="http://dublincore.org/documents/dces/">
    /// Dublin Core Metadata Element Set, Version 1.1
    /// </seealso>
    [Serializable]
    public sealed class Type : Triple
    {
        #region fields

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Collection"/> data.
        /// </summary>
        private static readonly IUriReference _collection = new UriReference("http://purl.org/dc/dcmitype/Collection");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Dataset"/> data.
        /// </summary>
        private static readonly IUriReference _dataset = new UriReference("http://purl.org/dc/dcmitype/Dataset");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Event"/> data.
        /// </summary>
        private static readonly IUriReference _event = new UriReference("http://purl.org/dc/dcmitype/Event");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Image"/> data.
        /// </summary>
        private static readonly IUriReference _image = new UriReference("http://purl.org/dc/dcmitype/Image");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.InteractiveResource"/> data.
        /// </summary>
        private static readonly IUriReference _interactiveResource = new UriReference("http://purl.org/dc/dcmitype/InteractiveResource");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.MovingImage"/> <see cref="P:Semantic.Rdf.DublinCore.Type.Object"/> data.
        /// </summary>
        private static readonly IUriReference _movingImage = new UriReference("http://purl.org/dc/dcmitype/MovingImage");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.PhysicalObject"/> data.
        /// </summary>
        private static readonly IUriReference _physicalObject = new UriReference("http://purl.org/dc/dcmitype/PhysicalObject");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Predicate"/> data.
        /// </summary>
        private static readonly IUriReference _predicate = new UriReference("http://purl.org/dc/elements/1.1/type");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Service"/> data.
        /// </summary>
        private static readonly IUriReference _service = new UriReference("http://purl.org/dc/dcmitype/Service");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Software"/> data.
        /// </summary>
        private static readonly IUriReference _software = new UriReference("http://purl.org/dc/dcmitype/Software");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Sound"/> data.
        /// </summary>
        private static readonly IUriReference _sound = new UriReference("http://purl.org/dc/dcmitype/Sound");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.StillImage"/> data.
        /// </summary>
        private static readonly IUriReference _stillImage = new UriReference("http://purl.org/dc/dcmitype/StillImage");

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.DublinCore.Type.Text"/> data.
        /// </summary>
        private static readonly IUriReference _text = new UriReference("http://purl.org/dc/dcmitype/Text");
        
        #endregion

        #region public Type(IUriReference, object)
        /// <overloads>
        /// Overloaded.
        /// Initializes a new instance of the <see cref="T:Semantic.Rdf.DublinCore.Type"/> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Semantic.Rdf.DublinCore.Type"/> class
        /// with the specified <paramref name="subject"/> and <paramref name="obj">object</paramref>.
        /// </summary>
        ///
        /// <param name="subject">The subject of the triple.</param>
        /// <param name="obj">The object of the triple.</param>
        /// 
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="subject"/> is a <see langword="null"/> reference.<br/>-or-<br/>
        /// <paramref name="obj"/> is a <see langword="null"/> reference.
        /// </exception>
        [SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "obj", Justification = "This is the appropriate naming.")]
        public Type(IUriReference subject, object obj)
            : base(subject, _predicate, obj)
        {
        }
        #endregion

        #region private Type(SerializationInfo, StreamingContext)
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Semantic.Rdf.DublinCore.Type"/> class
        /// from the specified instances of the <see cref="T:System.Runtime.Serialization.SerializationInfo"/>
        /// and <see cref="T:System.Runtime.Serialization.StreamingContext"/> classes.
        /// </summary>
        /// 
        /// <param name="info">
        /// An instance of the  <see cref="T:System.Runtime.Serialization.SerializationInfo"/> class
        /// containing the information required to serialize the
        /// new <see cref="T:Semantic.Rdf.BooleanLiteral"/> instance. 
        /// </param>
        /// <param name="context">
        /// An instance of the <see cref="T:System.Runtime.Serialization.StreamingContext"/> class
        /// containing the source of the serialized stream associated with the
        /// new <see cref="T:Semantic.Rdf.BooleanLiteral"/> instance.
        /// </param>
        /// 
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="info"/> is a <see langword="null"/> reference.
        /// </exception>
        private Type(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
        #endregion

        #region public static IUriReference Collection
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Collection-003">Collection</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Collection"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>An aggregation of resources.</description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   A collection is described as a group; its parts may also be separately described.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference Collection
        {
            get
            {
                return _collection;
            }
        }
        #endregion

        #region public static IUriReference DataSet
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Dataset-003">Dataset</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Dataset"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>Data encoded in a defined structure.</description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include lists, tables, and databases.
        ///   A dataset may be useful for direct machine processing.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference DataSet
        {
            get
            {
                return _dataset;
            }
        }
        #endregion

        #region public static IUriReference Event
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Event-003">Event</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Event"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>A non-persistent, time-based occurrence.</description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Metadata for an event provides descriptive information that is the basis for discovery of
        ///   the purpose, location, duration, and responsible agents associated with an event.
        ///   Examples include an exhibition, webcast, conference, workshop, open day, performance, battle, trial, wedding, tea party, conflagration.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference Event
        {
            get
            {
                return _event;
            }
        }
        #endregion

        #region public static IUriReference Image
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Image-004">Image</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Image"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>A visual representation other than text.</description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include images and photographs of physical objects, paintings, prints,
        ///   drawings, other images and graphics, animations
        ///   and moving pictures, film, diagrams, maps, musical notation.
        ///   Note that Image may include both electronic and physical representations.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference Image
        {
            get
            {
                return _image;
            }
        }
        #endregion

        #region public static IUriReference InteractiveResource
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#InteractiveResource-003">InteractiveResource</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/InteractiveResource"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>
        ///   A resource requiring interaction from the user to be understood, executed, or experienced.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include forms on Web pages, applets, multimedia learning objects, chat services, or virtual reality environments.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference InteractiveResource
        {
            get
            {
                return _interactiveResource;
            }
        }
        #endregion

        #region public static IUriReference MovingImage
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#MovingImage-003">MovingImage</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/MovingImage"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>
        ///   A series of visual representations imparting an impression of motion when shown in succession.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include animations, movies, television programs, videos, zoetropes, or visual output from a simulation.
        ///   Instances of the type Moving Image must also be describable as instances of the broader type Image.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference MovingImage
        {
            get
            {
                return _movingImage;
            }
        }
        #endregion

        #region public static IUriReference PhysicalObject
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#PhysicalObject-003">PhysicalObject</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/PhysicalObject"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>
        ///   An inanimate, three-dimensional object or substance.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Note that digital representations of, or surrogates for, these objects should use Image, Text or one of the other types.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference PhysicalObject
        {
            get
            {
                return _physicalObject;
            }
        }
        #endregion

        #region public static IUriReference Service
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Service-003">Service</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Service"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>
        ///   A system that provides one or more functions.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include a photocopying service, a banking service, an authentication service, interlibrary loans, a Z39.50 or Web server.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference Service
        {
            get
            {
                return _service;
            }
        }
        #endregion

        #region public static IUriReference Software
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Software-003">Software</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Software"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>
        ///   A computer program in source or compiled form.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include a C source file, MS-Windows .exe executable, or Perl script.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference Software
        {
            get
            {
                return _software;
            }
        }
        #endregion

        #region public static IUriReference Sound
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Sound-003">Sound</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Sound"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>
        ///   A computer program in source or compiled form.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include a C source file, MS-Windows .exe executable, or Perl script.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference Sound
        {
            get
            {
                return _sound;
            }
        }
        #endregion

        #region public static IUriReference StillImage
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#StillImage-003">StillImage</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/StillImage"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>A static visual representation.</description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include paintings, drawings, graphic designs, plans and maps.
        ///   Recommended best practice is to assign the type Text to images of textual materials.
        ///   Instances of the type Still Image must also be describable as instances of the broader type Image.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference StillImage
        {
            get
            {
                return _stillImage;
            }
        }
        #endregion

        #region public static IUriReference Text
        /// <summary>
        /// Gets a Dublin Core Type URI reference
        /// of <see href="http://dublincore.org/documents/dcmi-type-vocabulary/#Text-003">Text</see>.
        /// </summary>
        /// 
        /// <value>See the <see href="http://purl.org/dc/dcmitype/Text"/> definition.</value>
        /// 
        /// <remarks>
        /// <list type="table">
        /// <item>
        ///   <term>Definition</term>
        ///   <description>A resource consisting primarily of words for reading.</description>
        /// </item>
        /// <item>
        ///   <term>Comment</term>
        ///   <description>
        ///   Examples include books, letters, dissertations, poems, newspapers, articles, archives of mailing lists.
        ///   Note that facsimiles or images of texts are still of the genre Text.
        ///   </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// 
        /// <seealso href="http://dublincore.org/documents/dcmi-type-vocabulary/">
        /// DCMI Type Vocabulary
        /// </seealso>
        public static IUriReference Text
        {
            get
            {
                return _text;
            }
        }
        #endregion
    }
}